<template>
  <div class="background-decoration">
    <!-- 以房子为结构的炫酷动态背景 -->
    <div class="house-structure-background">
      <!-- 主体建筑结构 -->
      <div class="main-building">
        <!-- 建筑物主体 -->
        <div class="building-body"></div>

        <!-- 窗户网格 -->
        <div class="window-grid">
          <div class="window-row" v-for="row in 6" :key="row">
            <div class="window" v-for="col in 5" :key="col" :class="`window-${row}-${col}`"></div>
          </div>
        </div>

        <!-- 建筑顶部装饰 -->
        <div class="building-top"></div>

        <!-- 建筑底部基座 -->
        <div class="building-base"></div>
      </div>

      <!-- 周围建筑 -->
      <div class="surrounding-building building-left"></div>
      <div class="surrounding-building building-right"></div>

      <!-- 科技光环 -->
      <div class="tech-halo halo-1"></div>
      <div class="tech-halo halo-2"></div>
      <div class="tech-halo halo-3"></div>

      <!-- 数据流 -->
      <div class="data-stream stream-1"></div>
      <div class="data-stream stream-2"></div>
      <div class="data-stream stream-3"></div>
      <div class="data-stream stream-4"></div>

      <!-- 科技粒子 -->
      <div class="tech-particle particle-1"></div>
      <div class="tech-particle particle-2"></div>
      <div class="tech-particle particle-3"></div>
      <div class="tech-particle particle-4"></div>
      <div class="tech-particle particle-5"></div>
      <div class="tech-particle particle-6"></div>
      <div class="tech-particle particle-7"></div>
      <div class="tech-particle particle-8"></div>
      <div class="tech-particle particle-9"></div>
      <div class="tech-particle particle-10"></div>

      <!-- 电路节点 -->
      <div class="circuit-node node-1"></div>
      <div class="circuit-node node-2"></div>
      <div class="circuit-node node-3"></div>
      <div class="circuit-node node-4"></div>
      <div class="circuit-node node-5"></div>

      <!-- 光效 -->
      <div class="light-beam beam-1"></div>
      <div class="light-beam beam-2"></div>
      <div class="light-beam beam-3"></div>

      <!-- 扫描线 -->
      <div class="scan-line"></div>
    </div>

    <!-- 浮动装饰元素 -->
    <div class="floating-shape shape-1"></div>
    <div class="floating-shape shape-2"></div>
    <div class="floating-shape shape-3"></div>
  </div>
</template>

<script setup>
// 背景装饰组件，无需逻辑
</script>

<style scoped>
.background-decoration {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
  opacity: 0.6; /* 提高背景透明度，让动态效果更清晰 */
}

/* 房子结构背景 */
.house-structure-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #00c3ff 100%);
  overflow: hidden;
}

/* 主建筑 */
.main-building {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  height: 400px;
}

.building-body {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 300px;
  background: linear-gradient(45deg, rgba(30, 60, 114, 0.8), rgba(42, 82, 152, 0.8));
  border-radius: 10px 10px 0 0;
  box-shadow: 0 0 50px rgba(0, 195, 255, 0.3);
}

/* 窗户网格 */
.window-grid {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 160px;
  height: 240px;
  display: grid;
  grid-template-rows: repeat(6, 1fr);
  gap: 8px;
  padding: 20px;
}

.window-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.window {
  width: 20px;
  height: 20px;
  background: rgba(0, 195, 255, 0.6);
  border-radius: 2px;
  animation: windowBlink 3s infinite;
}

@keyframes windowBlink {
  0%, 70% { opacity: 0.6; }
  85%, 100% { opacity: 1; }
}

/* 建筑顶部 */
.building-top {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  height: 40px;
  background: linear-gradient(45deg, rgba(0, 195, 255, 0.8), rgba(42, 82, 152, 0.8));
  border-radius: 20px;
  box-shadow: 0 0 30px rgba(0, 195, 255, 0.5);
}

/* 建筑基座 */
.building-base {
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  height: 20px;
  background: linear-gradient(45deg, rgba(30, 60, 114, 0.9), rgba(0, 195, 255, 0.9));
  border-radius: 10px;
}

/* 周围建筑 */
.surrounding-building {
  position: absolute;
  bottom: 0;
  width: 80px;
  height: 200px;
  background: linear-gradient(45deg, rgba(30, 60, 114, 0.6), rgba(42, 82, 152, 0.6));
  border-radius: 5px 5px 0 0;
}

.building-left {
  left: 20%;
  animation: buildingGlow 4s infinite alternate;
}

.building-right {
  right: 20%;
  animation: buildingGlow 5s infinite alternate-reverse;
}

@keyframes buildingGlow {
  0% { box-shadow: 0 0 20px rgba(0, 195, 255, 0.3); }
  100% { box-shadow: 0 0 40px rgba(0, 195, 255, 0.6); }
}

/* 科技光环 */
.tech-halo {
  position: absolute;
  border: 2px solid rgba(0, 195, 255, 0.4);
  border-radius: 50%;
  animation: haloRotate 10s linear infinite;
}

.halo-1 {
  top: 30%;
  left: 30%;
  width: 100px;
  height: 100px;
}

.halo-2 {
  top: 60%;
  right: 25%;
  width: 150px;
  height: 150px;
  animation-duration: 15s;
  animation-direction: reverse;
}

.halo-3 {
  bottom: 20%;
  left: 20%;
  width: 80px;
  height: 80px;
  animation-duration: 8s;
}

@keyframes haloRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 数据流 */
.data-stream {
  position: absolute;
  width: 2px;
  height: 100px;
  background: linear-gradient(to bottom, transparent, rgba(0, 195, 255, 0.8), transparent);
  animation: streamFlow 3s linear infinite;
}

.stream-1 {
  top: 10%;
  left: 15%;
  animation-delay: 0s;
}

.stream-2 {
  top: 20%;
  right: 20%;
  animation-delay: 0.5s;
}

.stream-3 {
  bottom: 30%;
  left: 25%;
  animation-delay: 1s;
}

.stream-4 {
  bottom: 15%;
  right: 30%;
  animation-delay: 1.5s;
}

@keyframes streamFlow {
  0% { transform: translateY(-100px); opacity: 0; }
  50% { opacity: 1; }
  100% { transform: translateY(100px); opacity: 0; }
}

/* 科技粒子 */
.tech-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(0, 195, 255, 0.8);
  border-radius: 50%;
  animation: particleFloat 6s ease-in-out infinite;
}

.particle-1 { top: 20%; left: 10%; animation-delay: 0s; }
.particle-2 { top: 30%; right: 15%; animation-delay: 0.5s; }
.particle-3 { bottom: 40%; left: 20%; animation-delay: 1s; }
.particle-4 { bottom: 25%; right: 25%; animation-delay: 1.5s; }
.particle-5 { top: 60%; left: 30%; animation-delay: 2s; }
.particle-6 { top: 70%; right: 35%; animation-delay: 2.5s; }
.particle-7 { bottom: 60%; left: 40%; animation-delay: 3s; }
.particle-8 { bottom: 50%; right: 45%; animation-delay: 3.5s; }
.particle-9 { top: 40%; left: 60%; animation-delay: 4s; }
.particle-10 { top: 80%; right: 55%; animation-delay: 4.5s; }

@keyframes particleFloat {
  0%, 100% { transform: translateY(0px); opacity: 0.4; }
  50% { transform: translateY(-20px); opacity: 1; }
}

/* 电路节点 */
.circuit-node {
  position: absolute;
  width: 8px;
  height: 8px;
  background: rgba(0, 195, 255, 0.9);
  border-radius: 50%;
  box-shadow: 0 0 15px rgba(0, 195, 255, 0.6);
  animation: nodePulse 2s ease-in-out infinite;
}

.node-1 { top: 25%; left: 35%; animation-delay: 0s; }
.node-2 { top: 45%; right: 30%; animation-delay: 0.4s; }
.node-3 { bottom: 35%; left: 45%; animation-delay: 0.8s; }
.node-4 { bottom: 55%; right: 40%; animation-delay: 1.2s; }
.node-5 { top: 65%; left: 55%; animation-delay: 1.6s; }

@keyframes nodePulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.5); opacity: 1; }
}

/* 光效 */
.light-beam {
  position: absolute;
  width: 200px;
  height: 2px;
  background: linear-gradient(to right, transparent, rgba(0, 195, 255, 0.8), transparent);
  animation: beamSweep 4s ease-in-out infinite;
}

.beam-1 {
  top: 30%;
  left: 20%;
  transform: rotate(15deg);
  animation-delay: 0s;
}

.beam-2 {
  top: 60%;
  right: 20%;
  transform: rotate(-15deg);
  animation-delay: 1.5s;
}

.beam-3 {
  bottom: 40%;
  left: 30%;
  transform: rotate(45deg);
  animation-delay: 3s;
}

@keyframes beamSweep {
  0%, 100% { opacity: 0; transform: scale(0.5) rotate(var(--rotation, 0deg)); }
  50% { opacity: 1; transform: scale(1) rotate(var(--rotation, 0deg)); }
}

/* 扫描线 */
.scan-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(to right, transparent, rgba(0, 195, 255, 0.8), transparent);
  animation: scanMove 8s linear infinite;
}

@keyframes scanMove {
  0% { transform: translateY(0); }
  100% { transform: translateY(100vh); }
}

/* 浮动装饰元素 */
.floating-shape {
  position: absolute;
  border-radius: 50%;
  background: rgba(0, 195, 255, 0.1);
  animation: floatMove 15s ease-in-out infinite;
}

.shape-1 {
  top: 20%;
  left: 10%;
  width: 60px;
  height: 60px;
  animation-delay: 0s;
}

.shape-2 {
  top: 70%;
  right: 15%;
  width: 80px;
  height: 80px;
  animation-delay: 5s;
}

.shape-3 {
  bottom: 30%;
  left: 70%;
  width: 40px;
  height: 40px;
  animation-delay: 10s;
}

@keyframes floatMove {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(20px, -20px) rotate(90deg); }
  50% { transform: translate(-10px, -40px) rotate(180deg); }
  75% { transform: translate(-30px, -10px) rotate(270deg); }
}
</style>
